<template>
  <div>
    <div class="block6" v-if="user_7">
      <div class="outer2">
        <div class="section5">
          <div class="section6">
            <span class="word9">基本信息</span>
            <!-- <div class="bd7"> -->
            <!-- <el-button type="primary" size="mini" style="margin-right:10px" @click="personlinstall">人员设置</el-button> -->
            <!-- </div> -->
          </div>
        </div>
        <div class="section7">
          <div class="SingleAvatar24">
            <img class="label2" referrerpolicy="no-referrer" :src="getinfodata.wechat_avatar" />
          </div>
          <div style="display:flex;justify-content: space-between;width:80%;margin-left:30px">
            <div class="group1">
              <span class="word11">
                名称
                <span style="color:#333;font-size:14px">{{getinfodata.nickname}}</span>
              </span>
              <span class="word12">
                类别
                <span style="color:#333;font-size:14px" v-if="getinfodata.type==1">微信用户</span>
                <span style="color:#333;font-size:14px" v-if="getinfodata.type==2">普通会员</span>
                <span style="color:#333;font-size:14px" v-if="getinfodata.type==3">会员</span>
              </span>
              <span class="word12">
                生日
                <span style="color:#333;font-size:14px">{{getinfodata.birthday}}</span>
              </span>
              <span class="word12">
                路程花费
                <span style="color:#333;font-size:14px">{{getinfodata.cost_title}}</span>
              </span>
            </div>
            <!-- <div class="group2">
            <span class="word13">{{getinfodata.store_name}}</span>
            <span class="txt3">{{getinfodata.type}}</span>
            </div>-->
            <div class="group3">
              <span class="word14">
                手机
                <span style="color:#333;font-size:14px">{{getinfodata.phone}}</span>
              </span>
              <span class="txt4">
                地区
                <span style="color:#333;font-size:14px">{{getinfodata.address}}</span>
              </span>
              <span class="txt4">
                学习目标
                <span style="color:#333;font-size:14px">{{getinfodata.target_title}}</span>
              </span>
              <span class="txt4">
                来源渠道
                <span style="color:#333;font-size:14px">{{getinfodata.channel_title}}</span>
              </span>
            </div>
            <div>
              <span class="word14">
                性别
                <span v-if="getinfodata.sex==1" style="color:#333;font-size:14px">保密</span>
                <span v-if="getinfodata.sex==2" style="color:#333;font-size:14px">男</span>
                <span v-if="getinfodata.sex==3" style="color:#333;font-size:14px">女</span>
              </span>
              <span class="txt4">
                学习内容
                <span style="color:#333;font-size:14px">{{getinfodata.content_title}}</span>
              </span>
            </div>
            <!-- <span class="txt5">{{getinfodata.phone}}</span>
            <span class="txt6">{{getinfodata.channel_title}}</span>-->
            <div class="group4">
              <span class="word15">
                有效点数
                <span style="color:#333;font-size:14px">{{getinfodata.effective}}</span>
              </span>
              <span class="word16">
                赠送点数
                <span style="color:#333;font-size:14px">{{getinfodata.giving}}</span>
              </span>
              <span class="word16">
                学习时长
                <span style="color:#333;font-size:14px">{{getinfodata.length_title}}</span>
              </span>
            </div>
            <!-- <div class="group5">
            <span class="info4">{{getinfodata.effective}}</span>
            <span class="txt7">{{getinfodata.giving}}</span>
            </div>-->
          </div>
        </div>
        <div class="section8"></div>
        <span class="info5" v-if="user_8">用户标签</span>
        <div class="boxtips" v-if="user_8">
          <el-tag
            :key="tag"
            v-for="(tag,index) in dynamicTags"
            closable
            :disable-transitions="false"
            @close="handleClose(tag,index)"
          >{{tag}}</el-tag>
          <el-input
            class="input-new-tag"
            v-if="inputVisible"
            v-model="inputValue"
            ref="saveTagInput"
            size="small"
            @keyup.enter.native="handleInputConfirm"
            @blur="handleInputConfirm"
          ></el-input>
          <el-button v-else class="button-new-tag" size="small" @click="showInput">+ 新标签</el-button>
        </div>
      </div>
    </div>
    <div>
      <div class="section10">
        <div class="mod2">
          <span
            v-for="(item,index) in options"
            :class="currents==index?'optionitems':'optionitem'"
            @click="chaged(index,item.id)"
            :key="index"
          >{{item.text}}</span>
        </div>
        <el-button
          style="margin-right:12px;"
          v-show="currents==1"
          type="primary"
          size="mini"
          @click.native="rechargepop"
        >充值</el-button>
        <div v-show="currents==2" style="display:flex">
          <el-button type="primary" size="mini" @click.native="addappointment">添加预约</el-button>
          <el-button
            style="margin-right:12px;"
            type="primary"
            size="mini"
            @click.native="fixedseat"
          >固定座位</el-button>
        </div>
        <el-button
          style="margin-right:12px;"
          v-show="currents==3"
          type="primary"
          size="mini"
          @click.native="paypackage"
        >购买套餐</el-button>
      </div>
      <div class="block7">
        <div v-show="currents==0">
          <div class="block8">
            <el-table :data="usersetlist" border style="width: 99%">
              <el-table-column prop="state_time" label="套餐修改记录日期"></el-table-column>
              <el-table-column prop="setname" label="套餐名称"></el-table-column>
              <el-table-column prop="store" label="可用范围(适用门店)" show-overflow-tooltip>
                <template slot-scope="scope">
                  <span
                    v-for="(item,index) in scope.row.store"
                    :key="index"
                  >{{scope.row.store.length==1?item.store_name:item.store_name+","}}</span>
                </template>
              </el-table-column>
              <el-table-column label="剩余次数/天数/小时">
                <template slot-scope="scope">
                  <span v-if="scope.row.type==1">{{scope.row.num}}</span>
                  <span v-if="scope.row.type==3">{{scope.row.hour}}</span>
                </template>
              </el-table-column>
              <el-table-column prop="end_time" label="使用期限"></el-table-column>
              <!-- <el-table-column label="操作">
                <template slot-scope="scope">
                  <el-button @click.native.prevent="statedate(scope.row)" type="text">修改有效期</el-button>
                </template>
              </el-table-column> -->
            </el-table>
            <div class="layer3">
              <div class="block10"></div>
              <span class="info6">过期套餐</span>
            </div>
            <el-table
              :data="table2"
              :header-cell-style="headerStyle"
              :cell-style="cellStyle"
              style="width: 99%;background:#F1F1F1;border-top: 1px solid #E1E4E8;border-left: 1px solid #E1E4E8;border-right: 1px solid #E1E4E8;"
            >
              <el-table-column prop="setname" label="套餐名称"></el-table-column>
              <el-table-column prop="store" label="可用范围(适用门店)" show-overflow-tooltip>
                <template slot-scope="scope">
                  <span
                    v-for="(item,index) in scope.row.store"
                    :key="index"
                  >{{scope.row.store.length==1?item.store_name:item.store_name+","}}</span>
                </template>
              </el-table-column>
              <el-table-column label="剩余次数/天数/小时">
                 <template slot-scope="scope">
                  <span v-if="scope.row.type==1">{{scope.row.num}}</span>
                  <span v-if="scope.row.type==3">{{scope.row.hour}}</span>
                </template>
              </el-table-column>
              <el-table-column label="操作">
                <template slot-scope="scope">
                  <el-button @click.native.prevent="statedate(scope.row)" type="text">修改有效期</el-button>
                </template>
              </el-table-column>
            </el-table>
            <div style="width:100%;text-align:center;margin:50px auto;">
              <el-pagination
                background
                :page-size="10"
                :page-sizes="[10, 20, 50, 100]"
                layout="total,prev, sizes, pager, next, jumper"
                :total="totle"
                @size-change="handleSizeChange"
                @current-change="fenyeBtn"
              ></el-pagination>
            </div>
          </div>
        </div>
        <div v-show="currents==1" style="margin-bottom:10px">
          <el-table border :data="userChangelist" style="width: 99%" key="true">
            <el-table-column prop="recharge" label="充值点"></el-table-column>
            <el-table-column prop="give" label="赠送点"></el-table-column>
            <el-table-column prop="pay_money" label="支付金额"></el-table-column>
            <el-table-column prop="type" label="支付方式">
              <template slot-scope="scope">
                <span v-if="scope.row.type==1">微信支付</span>
                <span v-if="scope.row.type==2">后台添加</span>
              </template>
            </el-table-column>
            <el-table-column prop="create_time" label="支付时间"></el-table-column>
            <!-- <el-table-column label="点">
              <el-table-column prop="effectivepoint" label="有效点"></el-table-column>
              <el-table-column prop="invalidpoint" label="无效点"></el-table-column>
              <el-table-column prop="residualpoint" label="剩余点"></el-table-column>
            </el-table-column>-->
            <!-- <el-table-column prop="term" label="有效期">
              <template>
                <span>永久有效</span>
              </template>
            </el-table-column> -->
            <el-table-column prop="store_name" label="用户消费门店"></el-table-column>
            <el-table-column prop="desc" label="备注"></el-table-column>
            <!-- <el-table-column label="操作">
              <template slot-scope="scope">
                <el-button @click.native.prevent="deleteRow(scope.row)" type="text">扣减</el-button>
              </template>
            </el-table-column>-->
          </el-table>
          <div style="width:100%;text-align:center;margin:50px auto;">
            <el-pagination
              background
              :page-size="10"
              :page-sizes="[10, 20, 50, 100]"
              layout="total,prev, sizes, pager, next, jumper"
              :total="totle2"
              @size-change="handleSizeChange2"
              @current-change="fenyeBtn2"
            ></el-pagination>
          </div>
        </div>
        <div v-show="currents==2" style="margin-bottom:10px">
          <el-table border :data="tableDatarecord" style="width: 99%" :key="keyValue">
            <el-table-column prop="order_time" label="日期"></el-table-column>
            <el-table-column label="预约时间">
              <template slot-scope="scope">
                <div>{{scope.row.start_time}}</div>
                <div>{{scope.row.end_time}}</div>
              </template>
            </el-table-column>
            <el-table-column prop="store_name" label="门店"></el-table-column>
            <el-table-column prop="seat_number" label="座位详情"></el-table-column>
            <el-table-column prop="pay_type" label="支付方式">
              <template slot-scope="scope">
                <span v-if="scope.row.pay_type==1">微信支付</span>
                <span v-if="scope.row.pay_type==2">储值卡</span>
                <span v-if="scope.row.pay_type==3">后台添加</span>
              </template>
            </el-table-column>
            <el-table-column prop="orderstate" label="订单状态">
              <template slot-scope="scope" style="display:flex;align-items: center;">
                <span v-if="scope.row.status==1">待支付</span>
                <span v-if="scope.row.status==2">已支付</span>
                <span v-if="scope.row.status==3">已使用</span>
                <span v-if="scope.row.status==4">已退款</span>
                <span v-if="scope.row.status==5">取消订单</span>
                <span v-if="scope.row.status==6">已完成</span>
                <span v-if="scope.row.status==7">提前结束</span>
                <span v-if="scope.row.status==8">签退</span>
                <span v-if="scope.row.status==11">超时关闭</span>
              </template>
            </el-table-column>
            <el-table-column label="操作">
              <template slot-scope="scope">
                <el-button :disabled="scope.row.status==1||scope.row.status==3||scope.row.status==4||scope.row.status==5||scope.row.status==6||scope.row.status==11||scope.row.status==8||scope.row.status==7" @click.native.prevent="refund(scope.row)" type="text">退款</el-button>
                <el-button :disabled="scope.row.status==4||scope.row.status==5||scope.row.status==6||scope.row.status==7||scope.row.status==8||scope.row.status==11" @click.native.prevent="concelorder(scope.row)" type="text">取消订单</el-button>
                <!-- <el-button @click.native.prevent="viewdetails(scope.row)" type="text">查看详情</el-button> -->
              </template>
            </el-table-column>
          </el-table>
          <div style="width:100%;text-align:center;margin:50px auto;">
            <el-pagination
              background
              :page-size="10"
              :page-sizes="[10, 20, 50, 100]"
              layout="total,prev, sizes, pager, next, jumper"
              :total="totle3"
              @size-change="handleSizeChange3"
              @current-change="fenyeBtn3"
            ></el-pagination>
          </div>
        </div>
        <div v-show="currents==3" style="margin-bottom:10px">
          <el-table border :data="consumptionrecordlist" style="width: 99%" current-row-key="true">
            <el-table-column prop="order_time" label="日期"></el-table-column>
            <el-table-column prop="state" label="类型">
              <template slot-scope="scope">
                <span v-if="scope.row.state==1">次卡</span>
                <span v-if="scope.row.state==2">期卡</span>
                <span v-if="scope.row.state==3">小时卡</span>
                <span v-if="scope.row.state==4">储值点</span>
              </template>
            </el-table-column>
            <el-table-column label="点">
              <el-table-column prop="before_money" label="变动前"></el-table-column>
              <el-table-column prop="change" label="费用"></el-table-column>
              <el-table-column prop="after_money" label="变动后"></el-table-column>
            </el-table-column>
            <el-table-column prop="pay" label="微信"></el-table-column>
            <el-table-column prop="comment" label="大众点评"></el-table-column>
            <el-table-column prop="title" label="套餐"></el-table-column>
            <el-table-column prop="store_name" label="门店"></el-table-column>
            <el-table-column prop="reduction_money" label="减免"></el-table-column>
            <el-table-column prop="status" label="订单状态">
              <template slot-scope="scope">
                <span v-if="scope.row.status==0">待支付</span>
                <span v-if="scope.row.status==2">支付成功</span>
                <span v-if="scope.row.status==1">支付失败</span>
              </template>
            </el-table-column>
            <el-table-column prop="desc" label="备注"></el-table-column>
          </el-table>
          <div style="width:100%;text-align:center;margin:50px auto;">
            <el-pagination
              background
              :page-size="10"
              :page-sizes="[10, 20, 50, 100]"
              layout="total,prev, sizes, pager, next, jumper"
              :total="totle4"
              @size-change="handleSizeChange4"
              @current-change="fenyeBtn4"
            ></el-pagination>
          </div>
        </div>
        <div v-show="currents==4" style="margin-bottom:10px">
          <el-table border :data="recordtableData" style="width: 99%" :key="keyValue">
            <el-table-column prop="wechat_avatar" label="头像">
              <template slot-scope="scope">
                <img
                  :src="scope.row.wechat_avatar"
                  :fit="fit"
                  style="width:28px;height:28px;border-radius:4px;"
                  alt
                />
              </template>
            </el-table-column>
            <!-- <el-table-column prop="id" label="用户ID"></el-table-column> -->
            <el-table-column prop="nickname" label="昵称"></el-table-column>
            <el-table-column prop="add_time" label="邀请时间"></el-table-column>
          </el-table>
          <div style="width:100%;text-align:center;margin:50px auto;">
            <el-pagination
              background
              :page-size="10"
              :page-sizes="[10, 20, 50, 100]"
              layout="total,prev, sizes, pager, next, jumper"
              :total="totle5"
              @size-change="handleSizeChange5"
              @current-change="fenyeBtn5"
            ></el-pagination>
          </div>
        </div>
        <div v-show="currents==5" style="margin-bottom:10px">
          <el-table border :data="roomtableData" style="width: 99%" :key="keyValue">
            <el-table-column prop="order_time" label="日期"></el-table-column>
            <el-table-column label="时间">
              <template slot-scope="scope">
                  <span>{{scope.row.start_time}}</span> - <span>{{scope.row.end_time}}</span>
              </template>
            </el-table-column>
            <el-table-column prop="store_name" label="门店"></el-table-column>
            <el-table-column prop="room_name" label="会议室类型"></el-table-column>
            <el-table-column prop="status" label="订单状态">
              <template slot-scope="scope" style="display:flex;align-items: center;">
                <span v-if="scope.row.status==1">待支付</span>
                <span v-if="scope.row.status==2">已支付</span>
                <span v-if="scope.row.status==3">已使用</span>
                <span v-if="scope.row.status==4">已退款</span>
                <span v-if="scope.row.status==5">取消订单</span>
                <span v-if="scope.row.status==6">已完成</span>
                <span v-if="scope.row.status==7">提前结束</span>
                <span v-if="scope.row.status==8">签退</span>
                <span v-if="scope.row.status==11">超时关闭</span>
              </template>
            </el-table-column>
            <el-table-column label="操作">
              <template slot-scope="scope">
                <el-button :disabled="scope.row.status==1||scope.row.status==3||scope.row.status==4||scope.row.status==5||scope.row.status==6||scope.row.status==11||scope.row.status==8||scope.row.status==7" @click.native.prevent="refund5(scope.row)" type="text">退款</el-button>
                <!-- <el-button @click.native.prevent="viewdetails5(scope.row)" type="text">查看详情</el-button> -->
                <el-button :disabled="scope.row.status==4||scope.row.status==5||scope.row.status==6||scope.row.status==7||scope.row.status==8||scope.row.status==11" @click.native.prevent="concelorder5(scope.row)" type="text">取消订单</el-button>
              </template>
            </el-table-column>
          </el-table>
          <div style="width:100%;text-align:center;margin:50px auto;">
            <el-pagination
              background
              :page-size="10"
              :page-sizes="[10, 20, 50, 100]"
              layout="total,prev, sizes, pager, next, jumper"
              :total="totle6"
              @size-change="handleSizeChange6"
              @current-change="fenyeBtn6"
            ></el-pagination>
          </div>
        </div>
        <div v-show="currents==6" style="margin-bottom:10px">
           <el-table :data="usermealData" border style="width: 99%">
              <!-- <el-table-column prop="state_time" label="过期套餐日期"></el-table-column> -->
              <el-table-column prop="setname" label="名称"></el-table-column>
              <!-- <el-table-column prop="store" label="可用范围" show-overflow-tooltip>
                <template slot-scope="scope">
                  <span
                    v-for="(item,index) in scope.row.store"
                    :key="index"
                  >{{scope.row.store.length==1?item.store_name:item.store_name+","}}</span>
                </template>
              </el-table-column> -->
              <el-table-column label="剩余次数/小时">
                 <template slot-scope="scope">
                  <span v-if="scope.row.type==1">{{scope.row.num}}</span>
                  <span v-if="scope.row.type==3">{{scope.row.hour}}</span>
                </template>
              </el-table-column>
              <el-table-column prop="end_time" label="使用期限"></el-table-column>
              <el-table-column label="操作">
                <template slot-scope="scope">
                  <el-button @click.native.prevent="statedate(scope.row)" type="text">修改有效期</el-button>
                  <el-button @click.native.prevent="transfercard(scope.row)" type="text">转卡</el-button>
                  <el-button @click.native.prevent="delmeal(scope.row)" type="text">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          <div style="width:100%;text-align:center;margin:50px auto;">
            <el-pagination
              background
              :page-size="10"
              :page-sizes="[10, 20, 50, 100]"
              layout="total,prev, sizes, pager, next, jumper"
              :total="totle7"
              @size-change="handleSizeChange7"
              @current-change="fenyeBtn7"
            ></el-pagination>
          </div>
        </div>
        <div v-show="currents==7" style="margin-bottom:10px">
           <el-table :data="userstoreData" border style="width: 99%">
              <el-table-column prop="store_name" label="门店名称"></el-table-column>
              <el-table-column prop="storedvalue" label="储值点数"></el-table-column>
              <el-table-column label="操作">
                <template slot-scope="scope">
                  <el-button @click.native.prevent="koudian(scope.row)" type="text">扣除点数</el-button>
                </template>
              </el-table-column>
            </el-table>
          <!-- <div style="width:100%;text-align:center;margin:50px auto;">
            <el-pagination
              background
              :page-size="10"
              :page-sizes="[10, 20, 50, 100]"
              layout="total,prev, sizes, pager, next, jumper"
              :total="totle8"
              @size-change="handleSizeChange8"
              @current-change="fenyeBtn8"
            ></el-pagination>
          </div> -->
        </div>

         <div v-show="currents==8" style="margin-bottom:10px">
           <el-table :data="couponListData" border style="width: 99%">
              <el-table-column prop="coupon_name" label="优惠券名称"></el-table-column>
              <el-table-column prop="hour_num" label="小时数"></el-table-column>
              <el-table-column prop="start_time" label="开始时间"></el-table-column>
              <el-table-column prop="end_time" label="结束时间"></el-table-column>
              <el-table-column prop="status" label="优惠券状态"></el-table-column>
              <el-table-column label="操作">
                <template slot-scope="scope">
                  <el-button @click.native.prevent="delCoupon(scope.row)" type="text">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
           
        </div>
      </div>
    </div>
    <el-dialog title="修改套餐" :visible.sync="editdatepopup" width="30%">
      <el-form
        ref="formeditInfo"
        :rules="rules"
        :model="formeditInfo"
        class="demo-form-inline"
        label-width="100px"
      >
        <!-- <el-form-item v-if="mealtype==1" label="总次数" prop="alltimes">
          <el-input v-model="formeditInfo.alltimes">
            <template slot="append">次</template>
          </el-input>
        </el-form-item> -->
        <el-form-item v-if="mealtype==1" label="剩余次数" prop="surplus">
          <el-input v-model="formeditInfo.surplus" oninput="value=value.replace(/[^\d]/g,'')">
            <template slot="append">次</template>
          </el-input>
        </el-form-item>
        <el-form-item v-if="mealtype==3" label="剩余小时数" prop="hour">
          <el-input v-model="formeditInfo.hour" @input="changeFu">
            <template slot="append">小时</template>
          </el-input>
        </el-form-item>
        <!-- <el-form-item label="使用次数" prop="usertimes">
          <el-input v-model="formeditInfo.usertimes">
            <template slot="append">次</template>
          </el-input>
        </el-form-item> -->
        <el-form-item v-if="mealtype==1||mealtype==3" label="有效期至" prop="value1">
          <el-col :span="6">
            <el-date-picker
              v-model="formeditInfo.value1"
              value-format="yyyy-MM-dd"
              type="date"
              placeholder="选择日期"
            ></el-date-picker>
          </el-col>
        </el-form-item>
         <el-form-item v-if="mealtype==2" label="结束日期" prop="value2">
          <el-col :span="6">
            <el-date-picker
              v-model="formeditInfo.value2"
              value-format="yyyy-MM-dd"
              type="date"
              placeholder="选择日期"
            ></el-date-picker>
          </el-col>
        </el-form-item>
        <el-form-item style="text-align: right;">
          <el-button @click="editdatepopup=false">取消</el-button>
          <el-button type="primary" @click="submiteditForm('formeditInfo')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog title="减扣点数" :visible.sync="editvaluepopup" width="30%">
      <el-form
        ref="formvalueInfo"
        :rules="rules"
        :model="formvalueInfo"
        class="demo-form-inline"
        label-width="100px"
      >
      <el-form-item label="门店">
          <el-input :disabled="true" v-model="koustore"></el-input>
        </el-form-item>
        <el-form-item label="扣除点数" prop="surplu">
          <el-input v-model="formvalueInfo.surplu" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
        </el-form-item>
        <el-form-item style="text-align: right;">
          <el-button @click="editvaluepopup=false">取消</el-button>
          <el-button type="primary" @click="submiteditvalueForm('formvalueInfo')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <!-- <el-dialog title="成员设置" :visible.sync="dialogVisible" width="30%">
      <el-form
        ref="formInfo"
        :rules="rules"
        :model="formInfo"
        class="demo-form-inline"
        label-width="100px"
      >
        <el-form-item label="选择成员类型" prop="type">
          <el-select style="width:100%" v-model="formInfo.type" clearable placeholder="请选择">
            <el-option v-for="item in userlist" :key="item.id" :label="item.name" :value="item.id" />
          </el-select>
        </el-form-item>
        <el-form-item style="text-align: right;">
          <el-button @click="closeDialog()">取消</el-button>
          <el-button type="primary" @click="submitForm('formInfo')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>-->
    <!-- <el-dialog title="扣减点数" :visible.sync="delpopup" width="30%">
      <el-form
        ref="deduction"
        :rules="rules"
        :model="deduction"
        class="demo-form-inline"
        label-width="100px"
      >
        <el-form-item label="到期日期" prop="date">
          <span>{{deduction.date}}</span>
        </el-form-item>
        <el-form-item label="扣减点" prop="delpoint">
          <el-input v-model="deduction.delpoint">
            <template slot="append">点</template>
          </el-input>
        </el-form-item>
        <el-form-item label="时间" prop="time">
          <el-input v-model="deduction.time"></el-input>
        </el-form-item>
        <el-form-item label="扣减店铺" prop="shop">
          <span>{{deduction.shop}}</span>
        </el-form-item>
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="deduction.remarks"></el-input>
        </el-form-item>
        <el-form-item style="text-align: right;">
          <el-button @click="closeDialogs()">取消</el-button>
          <el-button type="primary" @click="submitForms('deduction')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>-->
    <el-dialog title="充值" @close="handleClosed" :visible.sync="rechargepopup" width="50%">
      <el-form
        ref="recharge"
        :rules="rules"
        :model="recharge"
        class="demo-form-inline"
        label-width="100px"
      >
        <el-form-item label="充值点" prop="point">
          <el-input v-model="recharge.point" oninput="value=value.replace(/[^\d]/g,'')">
            <template slot="append">点</template>
          </el-input>
        </el-form-item>
        <!-- <el-form-item label="时间" prop="time">
          <el-col :span="6">
            <el-date-picker
              v-model="recharge.time"
              value-format="yyyy-MM-dd"
              type="date"
              placeholder="选择日期时间"
            ></el-date-picker>
          </el-col>
        </el-form-item>-->
        <el-form-item label="充值店铺" prop="shop">
          <!-- <el-col :span="6"> -->
          <el-select v-model="recharge.shop" @change="changeupstore" style="width:50%" placeholder="请选择">
            <el-option
              v-for="item in storelist1"
              :key="item.id"
              :label="item.store_name"
              :value="item.id"
            ></el-option>
          </el-select>
          <!-- </el-col> -->
        </el-form-item>
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="recharge.remarks"></el-input>
        </el-form-item>
        <!-- <el-form-item label="需付金额" prop="price">
          <el-input v-model="recharge.price">
            <template slot="append">元</template>
          </el-input>
        </el-form-item> -->
        <!-- <el-form-item label="过期时间" prop="expirationtime">
          <el-date-picker
            style="width:50%"
            v-model="recharge.expirationtime"
            value-format="yyyy-MM-dd"
            type="date"
            placeholder="选择日期时间"
          ></el-date-picker>
        </el-form-item> -->
        <!-- <el-col :span="6">
          <span style="font-weight:400;margin-left:100px;color:333;white-space: nowrap;">不选则永久有效</span>
        </el-col> -->

        <el-form-item style="text-align: right;">
          <el-button @click="rechargecloseDialogs()">取消</el-button>
          <el-button type="primary" @click="rechargesubmitForms('recharge')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog :title="tits" @close="handleClosed1" :visible.sync="appointment" width="50%">
      <el-form
        ref="formappointment"
        :rules="rules"
        :model="formappointment"
        class="demo-form-inline"
        label-width="100px"
      >
        <el-form-item label="预约店铺" prop="store_shop">
          <!-- <el-input v-model="formappointment.shop" disabled></el-input> -->
          <!-- <el-col :span="6"> -->
          <el-select v-model="formappointment.store_shop" style="width:50%" @change="changestores" placeholder="请选择">
            <el-option
              v-for="item in storelist"
              :key="item.id"
              :label="item.store_name"
              :value="item.id"
            ></el-option>
          </el-select>
          <!-- </el-col> -->
        </el-form-item>
        <el-form-item v-if="tits=='添加预约'" label="预约日期" prop="date">
          <!-- <el-input v-model="formappointment.date" placeholder="请选择"></el-input> -->
          <!-- <el-col :span="6"> -->
          <el-date-picker
            style="width:50%"
            :picker-options="pickerOptions"
            value-format="yyyy-MM-dd"
            v-model="formappointment.date"
            @change="changestartdata"
            type="date"
            placeholder="选择日期"
          ></el-date-picker>
          <!-- </el-col> -->
        </el-form-item>
        <el-form-item label="选择日期" v-if="tits=='固定座位'" prop="date1">
          <el-date-picker
          v-model="formappointment.date1"
          type="daterange"
          value-format="yyyy-MM-dd"
          @change="changestarttimes"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>
        </el-form-item>
        <el-form-item v-if="tits=='添加预约'" label="预约开始" prop="appointmentstart">
          <!-- <el-input v-model="formappointment.appointmentstart" placeholder="请选择"></el-input> -->
          <el-time-select
            placeholder="选择时间"
            style="width:50%;"
            v-model="formappointment.appointmentstart"
            @change="changestartappo"
            :picker-options="{
                      start: '00:00',
                      step: '00:30',
                      end: '24:00',
                      maxTime: formappointment.appointmentend
                    }"
          ></el-time-select>
        </el-form-item>
        <!-- <el-form-item label="结束日期" prop="enddate">
          <el-date-picker
            style="width:50%"
            :picker-options="pickerOptions"
            value-format="yyyy-MM-dd"
            v-model="formappointment.enddate"
            @change="changeenddata"
            type="date"
            placeholder="选择日期"
          ></el-date-picker>
        </el-form-item> -->
        <el-form-item v-if="tits=='添加预约'" label="预约结束" prop="appointmentend">
          <el-time-select
            placeholder="选择时间"
            style="width:50%;"
            v-model="formappointment.appointmentend"
            @change="changeendappo"
            :picker-options="{
                      start: '00:00',
                      step: '00:30',
                      end: '24:00',
                      minTime: formappointment.appointmentstart
                    }"
          ></el-time-select>
        </el-form-item>
        <el-form-item label="预约座位" v-if="isshop" prop="reservedseats">
          <div v-for="(item,index) in seatlist" :key="index" style="margin-bottom:20px;">
            <div style="display:flex;">{{item.title}}</div>
            <!--  -->
            <div style="display:flex;flex-wrap:wrap;">
              <div
                v-for="(items,indexs) in item.seat"
                :key="indexs"
                @click="ckeckdatas(items,item)"
                :class="isActiveFn(items)?'active':items.check==false?'itemcont':'itemconts'"
              >
                {{items.seat_name}}
                <img
                  src="../../../assets/img/duihao.png"
                  v-if="items.id==currentindex"
                  style="width:26px;height:24px;position: absolute;"
                  alt
                />
              </div>
            </div>
          </div>
        </el-form-item>
        <el-form-item label="选择套餐" prop="selectpackage">
          <el-select
            style="width:50%"
            v-model="formappointment.selectpackage"
            @change="mealchage($event,Meallist)"
            placeholder="请选择"
          >
            <el-option
              v-for="item in Meallist"
              :key="item.id"
              :label="item.setname"
              :value="item.id"
            />
            <!-- <el-pagination
              small
              layout="prev, pager, next"
              hide-on-single-page
              :total="totle2s"
              @current-change="fenyeBtn2s"
            ></el-pagination> -->
          </el-select>
        </el-form-item>
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="formappointment.remarks"></el-input>
        </el-form-item>
        <el-form-item style="text-align: right;">
          <el-button @click="resetForm('formappointment')">重置</el-button>
          <el-button type="primary" v-if="tits=='添加预约'" @click="appointmentsubmitForm('formappointment')">确定</el-button>
          <el-button type="primary" v-if="tits=='固定座位'" @click="appointmentsubmitForms('formappointment')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog title="购买套餐" @close="handleClosed2" :visible.sync="paypopup" width="50%">
      <el-form
        ref="payform"
        :rules="rules"
        :model="payform"
        class="demo-form-inline"
        label-width="100px"
      >
        <el-form-item label="充值店铺" prop="shops">
          <!-- <el-input v-model="payform.shop" disabled></el-input> -->
          <!-- <el-col :span="6"> -->
          <el-select v-model="payform.shops" @change="getstoremeal" style="width:50%" placeholder="请选择">
            <el-option
              v-for="item in storelists"
              :key="item.id"
              :label="item.store_name"
              :value="item.id"
            ></el-option>
          </el-select>
          <!-- </el-col> -->
        </el-form-item>
        <el-form-item label="套餐选择" prop="mealchoose">
          <el-select
            style="width:50%"
            v-model="payform.mealchoose"
            @change="buymealchage($event)"
            placeholder="请选择"
          >
            <el-option
              v-for="item in Meallists"
              :key="item.id"
              :label="item.title"
              :value="item.id"
            />
            <!-- <el-pagination
              small
              layout="prev, pager, next"
              hide-on-single-page
              :total="totle3s"
              @current-change="fenyeBtn3s"
            ></el-pagination> -->
          </el-select>
        </el-form-item>
        <div v-if="isdaynum">
           <el-radio-group v-model="radio1" @change="radiochang">
          <div class="flexwap" v-for="(item,index) in daynumlist" :key="index">
          <el-form-item label="天数">
            <el-input disabled v-model="item.day">
              <template slot="append">天</template>
            </el-input>
          </el-form-item>
          <el-form-item label="价格">
            <el-input disabled v-model="item.price">
              <template slot="append">元</template>
            </el-input>
          </el-form-item>
           <el-radio style="margin-left:20px" :label="item.id" border>选择此套餐</el-radio>
        </div>
          </el-radio-group>
        </div>
        <el-form-item label="购买数量" prop="num">
          <el-col :span="5">
            <el-input-number
              v-model="payform.num"
              @change="handleChange"
              :min="1"
              :max="10"
              label="购买数量"
            ></el-input-number>
          </el-col>
        </el-form-item>
        <el-form-item label="实付金额" prop="price">
          <el-input v-model="payform.price">
            <template slot="append">元</template>
          </el-input>
        </el-form-item>
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="payform.remarks"></el-input>
        </el-form-item>
        <el-form-item style="text-align: right;">
          <el-button @click="paycancel('payform')">取消</el-button>
          <el-button type="primary" @click="payconfig('payform')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog title="选择门店" @close="closezk" :visible.sync="zhunkapop" width="50%">
      <el-form
        :model="zkdata"
        class="demo-form-inline"
        label-width="100px"
      >
      <el-form-item label="转卡门店" prop="">
          <el-select v-model="zkdata.store" style="width:50%" @change="changestore" placeholder="请选择">
            <el-option
              v-for="item in storemenus"
              :key="item.id"
              :label="item.store_name"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
      <el-form-item style="text-align: right;">
          <el-button @click="zhunkapop=false">取消</el-button>
          <el-button type="primary" @click="configzhunkapop()">确定</el-button>
        </el-form-item>
    </el-form>
    </el-dialog>
    <!-- <el-dialog title="预约详情" :visible.sync="appointmentdetails" width="50%">
      <el-form ref="appoopopupdata" :model="appoopopupdata" class="demo-form-inline" :rules="rules">
        <div class="tips1">
          <div class="centtip">
            <div style="display:flex;justify-content: space-between;margin-bottom:42px;">
              <div>{{appoopopupdata.store_name}}</div>
              <div>{{appoopopupdata.seat_number}}</div>
              <div></div>
            </div>
            <div style="display:flex;justify-content: space-between;">
              <span v-if="appoopopupdata.status==1">待支付</span>
              <span v-if="appoopopupdata.status==2">已支付</span>
              <span v-if="appoopopupdata.status==3">已使用</span>
              <span v-if="appoopopupdata.status==4">已退款</span>
              <span v-if="appoopopupdata.status==5">取消订单</span>
              <span v-if="appoopopupdata.status==6">已完成</span>
              <span v-if="appoopopupdata.status==7">提前结束</span>
              <span v-if="appoopopupdata.status==8">签退</span>
              <span v-if="appoopopupdata.status==11">超时关闭</span>
              <div>预定日期：{{appoopopupdata.order_time}}</div>
              <div>{{appoopopupdata.start_time}} - {{appoopopupdata.end_time}}</div>
            </div>
          </div>
        </div>
        <el-form-item style="text-align: right;">
          <el-button type="primary" @click="appointmentdetails=false">关闭</el-button>
        </el-form-item>
      </el-form>
    </el-dialog> -->
    <!-- <el-dialog title="会议室详情" :visible.sync="roomdetails" width="50%">
      <el-form ref="roomdata" :model="roomdata" class="demo-form-inline" :rules="rules">
        <div class="tips1">
          <div class="centtip">
            <div style="display:flex;justify-content: space-between;margin-bottom:42px;">
              <div>{{roomdata.store_name}}</div>
              <div>{{roomdata.room_name}}</div>
              <div></div>
            </div>
            <div style="display:flex;justify-content: space-between;">
              <span v-if="roomdata.status==1">待支付</span>
              <span v-if="roomdata.status==2">已支付</span>
              <span v-if="roomdata.status==3">已使用</span>
              <span v-if="roomdata.status==4">已退款</span>
              <span v-if="roomdata.status==5">取消订单</span>
              <span v-if="roomdata.status==6">已完成</span>
              <span v-if="roomdata.status==7">提前结束</span>
              <span v-if="roomdata.status==8">签退</span>
              <span v-if="roomdata.status==11">超时关闭</span>
              <div>预定日期：{{roomdata.order_time}}</div>
              <div>{{roomdata.start_time}} - {{roomdata.end_time}}</div>
            </div>
          </div>
        </div>
        <el-form-item style="text-align: right;">
          <el-button type="primary" @click="roomdetails=false">关闭</el-button>
        </el-form-item>
      </el-form>
    </el-dialog> -->
  </div>
</template>

<script>
import {
  couponDel,
  couponList,
  userPersonnel,
  userClass,
  userChange,
  userSet,
  setMealDel,
  userLabel,
  labelDel,
  operation,
  userAppointment,
  meeting,
  invitation,
  packages,
  userChangeOrder,
  appointReturn,
  appointmentReturn,
  appointmentAdd,
  consume,
  reimburse,
  drawback,
  userSeat,
  packageReturn,
  choice,
  buymeal,
  usersetMeal,
  lists,
  stored,
  storedSub,
  userOrderCancel,
  transfer,
} from "@/api/user";
import { adminStore } from "@/api/menu";
import Base64 from "@/utils/base";
import { getp_id } from "@/utils/getmenuid";

export default {
  data() {
    return {
      zkdata:{
        store:""
      },
      store_name1: "",
      totle: 10,
      num: 10,
      page: 1,
      genid: "",
      storelist: "",
      storelists: "",
      storelist1: "",
      storemenus:"",
      seatlist: "",
      dynamicTags: [],
      inputVisible: false,
      inputValue: "",
      value: "",
      tits: "",
      // appointmentdetails: false,
      keyValue: true,
      keyValues: true,
      paypopup: false,
      // roomdetails: false,
      radio1: "",
      radio2: "",
      pickerOptions: {
        disabledDate(date) {
          return date.getTime() < Date.now() - 24 * 60 * 60 * 1000;
        },
        // shortcuts: [
        //   {
        //     text: "今天",
        //     onClick(picker) {
        //       picker.$emit("pick", new Date());
        //     }
        //   },
        //   {
        //     text: "昨天",
        //     onClick(picker) {
        //       const date = new Date();
        //       date.setTime(date.getTime() - 3600 * 1000 * 24);
        //       picker.$emit("pick", date);
        //     }
        //   },
        //   {
        //     text: "一周前",
        //     onClick(picker) {
        //       const date = new Date();
        //       date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
        //       picker.$emit("pick", date);
        //     }
        //   }
        // ]
      },
      rules: {
        // num: [
        //   {
        //     required: true,
        //     message: "请输入购买数量",
        //     trigger: "change"
        //   }
        // ],
        // alltimes: [
        //   { required: true, message: "请输入总次数", trigger: "change" }
        // ],
        surplus: [
          { required: true, message: "请输入剩余次数", trigger: "change" },
        ],
        surplu: [
          { required: true, message: "请输入扣除点数", trigger: "change" },
        ],
        value1: [
          { required: true, message: "请选择有效期", trigger: "change" },
        ],
        date: [
          { required: true, message: "请选择预约日期", trigger: "change" },
        ],
        date1: [{ required: true, message: "请选择日期", trigger: "change" }],
        appointmentstart: [
          { required: true, message: "请选择预约开始时间", trigger: "change" },
        ],
        appointmentend: [
          { required: true, message: "请选择预约结束时间", trigger: "change" },
        ],
        store_shop: [
          { required: true, message: "请选择预约店铺", trigger: "change" },
        ],
        shop: [
          { required: true, message: "请选择充值店铺", trigger: "change" },
        ],
        shops: [
          { required: true, message: "请选择充值店铺", trigger: "change" },
        ],
        // selectpackage: [
        //   { required: true, message: "请选择套餐", trigger: "change" }
        // ],
        // enddate: [
        //   { required: true, message: "请选择结束日期", trigger: "change" }
        // ],
        delpoint: [
          { required: true, message: "请输入扣减点", trigger: "change" },
        ],
        point: [{ required: true, message: "请输入充值点", trigger: "change" }],
        time: [{ required: true, message: "请输入时间", trigger: "change" }],
        // shop: [
        //   { required: true, message: "请输入扣减店铺", trigger: "change" }
        // ],
        mealchoose: [
          { required: true, message: "请选择套餐", trigger: "change" },
        ],
      },
      delpopup: false,
      rechargepopup: false,
      appointment: false,
      tableDatarecord: "",
      table1: [],
      table2: "",
      itemlist: [],
      consumptionrecordlist: "",
      recordtableData: "",
      roomtableData: "",
      usermealData: "",
      userstoreData: "",
      couponListData: "",
      appointmentends: [
        {
          id: 12,
          value: "10:30",
        },
        {
          id: 14,
          value: "11:30",
        },
        {
          id: 13,
          value: "12:30",
        },
      ],
      Meallist: "",
      Meallists: "",
      totle2: 10,
      num2: 10,
      page2: 1,
      totle3: 10,
      num3: 10,
      page3: 1,
      totle4: 10,
      num4: 10,
      page4: 1,
      totle5: 10,
      num5: 10,
      page5: 1,
      totle6: 10,
      num6: 10,
      page6: 1,
      totle7: 10,
      num7: 10,
      page7: 1,
      totle8: 10,
      num8: 10,
      page8: 1,
      totle2s: 10,
      page2s: 1,
      num2s: 10,
      totle3s: 10,
      page3s: 1,
      num3s: 10,
      typeid: "",
      daynumlist: "",
      cardday: "",
      cardprice: "",
      mealid: "",
      isdaynum: false,
      currentindex: -1,
      formappointment: {
        store_shop: "",
        date: "",
        selectpackage: "",
        appointmentstart: "",
        enddate: "",
        appointmentend: "",
        remarks: "",
        reservedseats: "",
        date1: "",
      },
      payform: {
        shops: "",
        mealchoose: "",
        price: "",
        num: 1,
        remarks: "",
      },
      // selevalue:'',
      // selevalue1:'',
      dialogVisible: false,
      type: [
        {
          id: 1,
          text: "测试",
        },
        {
          id: 2,
          text: "管理员",
        },
      ],
      formInfo: {
        type: "",
      },
      deduction: {
        date: "2022-01-08",
        delpoint: "0",
        time: "2022-01-07 15:555:26",
        shop: "车公庙店",
        remarks: "",
      },
      recharge: {
        point: "",
        time: "",
        shop: "",
        remarks: "",
        price: "",
        // expirationtime: ""
      },
      isshop: false,
      current: 0,
      currents: 0,
      options: [],
      formeditInfo: {
        value1: "",
        surplus: "",
        value2: "",
      },
      formvalueInfo: {
        surplu: "",
        store_name: "",
      },
      getinfodata: "",
      // appoopopupdata: "",
      // roomdata: "",
      userlist: "",
      usersetlist: "",
      userChangelist: "",
      storeid: "",
      buynum: 1,
      mealtype: 1,
      koustore: "",
      us_id: "",
      editdatepopup: false,
      editvaluepopup: false,
      user_7: false,
      user_8: false,
      user_10: false,
      user_11: false,
      user_12: false,
      user_13: false,
      user_14: false,
      user_15: false,
      user_16: false,
      user_17: false,
      user_22: false,
      zhunkapop: false,
      tcid:"",
      store_id:""
    };
  },
  created() {
    // 门店名称，储值点数，扣除点数
    this.getlists();
    this.storemenus = JSON.parse(localStorage.getItem("storemenus"))
    if (this.$route.query.label == "") {
      this.dynamicTags = [];
    }
    if (typeof this.$route.query.label == "string") {
      this.dynamicTags.push(this.$route.query.label);
    }
    if (typeof this.$route.query.label == "object") {
      this.dynamicTags = this.$route.query.label;
    }
    this.getinfodata = this.$route.query;
    // this.getuserClass();
    this.current = 0;
    this.currents = 0;
    this.getuserSet();
    this.getsetMeal();
    // this.getsetMeals();
    this.storelist =
      JSON.parse(localStorage.getItem("storemenu"))[0].id != ""
        ? JSON.parse(localStorage.getItem("storemenu"))
        : this.getadminStore();
    this.storelists =
      JSON.parse(localStorage.getItem("storemenu"))[0].id != ""
        ? JSON.parse(localStorage.getItem("storemenu"))
        : this.getadminStore();

    this.storelist1 =
      JSON.parse(localStorage.getItem("storemenu"))[0].id != ""
        ? JSON.parse(localStorage.getItem("storemenu"))
        : this.getadminStore();
  },
  methods: {
    //
    getlists() {
      lists({
        request_data: Base64.encode(
          JSON.stringify({ pid: localStorage.getItem("getpid") })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        let btnarr = [];
        res.result.map((v) => {
          btnarr.push(v.class_mark);
        });
        btnarr.forEach((item) => {
          if (item === "user_7") {
            this.user_7 = true;
          }
          if (item === "user_8") {
            this.user_8 = true;
          }
          if (item === "user_10") {
            this.options.push({
              id: "user_10",
              text: "套餐记录",
            });
            this.user_10 = true;
          }
          if (item === "user_11") {
            this.options.push({
              id: "user_11",
              text: "充值记录",
            });
            this.user_11 = true;
          }
         
          
          
          if (item === "user_12") {
            this.options.push({
              id: "user_12",
              text: "预约记录",
            });
            this.user_12 = true;
          }
          if (item === "user_13") {
            this.options.push({
              id: "user_13",
              text: "消费记录",
            });
            this.user_13 = true;
          }
          if (item === "user_14") {
            this.options.push({
              id: "user_14",
              text: "邀请记录",
            });
            this.user_14 = true;
          }
          if (item === "user_15") {
            this.options.push({
              id: "user_15",
              text: "会议室记录",
            });
            this.user_15 = true;
          }
          if (item === "user_16") {
            this.options.push({
              id: "user_16",
              text: "套餐列表",
            });
            this.user_16 = true;
          }
          if (item === "user_17") {
            this.options.push({
              id: "user_17",
              text: "储值列表",
            });
            this.user_17 = true;
          }
            if (item === "user_17") {
            this.options.push({
              id: "user_22",
              text: "优惠券列表",
            });
            this.user_22 = true;
          }
        });
      });
      
      // console.log(this.options,"123")
    },
    //选择套餐
    getstoremeal(e) {
      this.storeid = e;
      this.isdaynum = false;
      this.cardday = "";
      this.cardprice = "";
      this.payform.mealchoose = "";
      this.radio1 = "";
      choice({
        request_data: Base64.encode(JSON.stringify({ store_id: e })),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        // console.log(res)
        if (res.result.length == 0) {
          this.payform.mealchoose = "";
        }
        this.Meallists = res.result;
      });
    },
    // pickerOptions: {
    //   disabledDate(date) {
    //     //disabledDate 文档上：设置禁用状态，参数为当前日期，要求返回 Boolean
    //     return date.getTime() < Date.now() - 24 * 60 * 60 * 1000;
    //   },
    // },
    getadminStore() {
      adminStore({
        request_data: Base64.encode(JSON.stringify({ store_id: "" })),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.storelist = res.data;
        this.storelists = res.data;
        this.storelist1 = res.data;
        return res.data;
      });
    },
    //修改有效期
    statedate(val) {
      this.mealid = val.id;
      this.mealtype = val.type;
      if (val.type == 3) {
        this.formeditInfo.value1 = val.end_time;
        this.formeditInfo.hour = val.hour;
      }
      if (val.type == 1) {
        this.formeditInfo.value1 = val.end_time;
        this.formeditInfo.surplus = val.num;
        // this.formeditInfo.alltimes = val.total
      }
      if (val.type == 2) {
        this.formeditInfo.value2 = val.end_time;
      }
      this.editdatepopup = true;
    },
    //转卡
    transfercard(val) {
      this.zhunkapop = true
      this.tcid = val.id
    },
    closezk(){
      this.zkdata.store = ""
    },
    //选择门店
    changestore(val){
      this.store_id = val
    },
    configzhunkapop(){
      if(this.store_id==""){
        this.$message({
          message: "请选择门店",
          type: 'warning'
        })
        return
      }
      transfer({
        request_data: Base64.encode(JSON.stringify({
          user_id:this.getinfodata.id,
          id:this.tcid,
          after_store_id:this.store_id
        }))
      }).then(res => {
        if (res.status != 1) {
          this.$message({
            message: res.message,
            type: 'warning'
          })
          return
        }
        this.zhunkapop = false
        this.$message({
            message: res.message,
            type: 'warning'
          })
      })
    },
    //扣除点数
    koudian(val) {
      this.koustore = val.store_name;
      this.us_id = val.us_id;
      this.editvaluepopup = true;
    },
    //删除套餐
    delmeal(val) {
      this.$confirm("确定删除此条数据吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          let parmes = {
            id: val.id,
          };
          setMealDel({
            request_data: Base64.encode(JSON.stringify(parmes)),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.$message({
              message: "删除成功",
              type: "success",
            });
            this.getusersetMeal();
          });
        })
        .catch(() => {});
    },
    //获取人员类型列表
    // getuserClass() {
    //   userClass().then(res => {
    //     console.log(res.result);
    //     this.userlist = res.result;
    //     this.formInfo.type =
    //       Number(localStorage.getItem("personneltype")) || "";
    //   });
    // },
    handleSizeChange(val) {
      this.num = val;
      this.getuserSet(this.page, this.num);
    },
    fenyeBtn(e) {
      this.page = e;
      this.getuserSet(this.page, this.num);
    },
    handleSizeChange2(val) {
      this.num2 = val;
      this.getuserChange(this.page2, this.num2);
    },
    fenyeBtn2(e) {
      this.page2 = e;
      this.getuserChange(this.page2, this.num2);
    },
    handleSizeChange3(val) {
      this.num3 = val;
      this.getuserAppointment(this.page3, this.num3);
    },
    fenyeBtn3(e) {
      this.page3 = e;
      this.getuserAppointment(this.page3, this.num3);
    },
    handleSizeChange4(val) {
      this.num4 = val;
      this.getconsume(this.page4, this.num4);
    },
    fenyeBtn4(e) {
      this.page4 = e;
      this.getconsume(this.page4, this.num4);
    },
    handleSizeChange5(val) {
      this.num5 = val;
      this.getinvitation(this.page5, this.num5);
    },
    fenyeBtn5(e) {
      this.page5 = e;
      this.getinvitation(this.page5, this.num5);
    },
    handleSizeChange6(val) {
      this.num6 = val;
      this.getmeeting(this.page6, this.num6);
    },
    fenyeBtn6(e) {
      this.page6 = e;
      this.getmeeting(this.page6, this.num6);
    },
    handleSizeChange7(val) {
      this.num7 = val;
      this.getusersetMeal(this.page7, this.num7);
    },
    fenyeBtn7(e) {
      this.page7 = e;
      this.getusersetMeal(this.page7, this.num7);
    },
    handleSizeChange8(val) {
      this.num8 = val;
      this.getuserstored(this.page8, this.num8);
    },
    fenyeBtn8(e) {
      this.page8 = e;
      this.getuserstored(this.page8, this.num8);
    },
    //套餐记录
    getuserSet(page, num) {
      let parmes = {
        page: page || this.page,
        limit: num || this.num,
        user_id: this.getinfodata.id,
      };
      userSet({
        request_data: Base64.encode(JSON.stringify(parmes)),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.usersetlist = res.result.set;
        this.totle = res.result.count;
        this.table2 = res.result.user_set;
      });
    },
    headerStyle() {
      return "background:#f1f1f1;";
    },
    //充值记录
    getuserChange(page, num) {
      let parmes = {
        page: page || this.page2,
        limit: num || this.num2,
        user_id: this.getinfodata.id,
      };
      userChange({
        request_data: Base64.encode(JSON.stringify(parmes)),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.userChangelist = res.result.data;
        this.totle2 = res.result.count;
      });
    },
    //预约记录
    getuserAppointment(page, num) {
      let parmes = {
        page: page || this.page3,
        limit: num || this.num3,
        user_id: this.getinfodata.id,
      };
      userAppointment({
        request_data: Base64.encode(JSON.stringify(parmes)),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.tableDatarecord = res.result.data;
        this.totle3 = res.result.count;
      });
    },
    //获取套餐列表
    getsetMeal(page, num) {
      let parmes = {
        page: page || this.page2s,
        limit: num || this.num2s,
        user_id: this.getinfodata.id,
      };
      packages({
        request_data: Base64.encode(JSON.stringify(parmes)),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.Meallists = res.result.data;
        this.totle2s = res.result.count;
      });
    },
    // //获取套餐列表
    // getsetMeals(page, num) {
    //   let parmes = {
    //     page: page || this.page3s,
    //     limit: num || this.num3s,
    //     user_id:this.getinfodata.id
    //   };
    //   setMeals({
    //     request_data: Base64.encode(JSON.stringify(parmes))
    //   }).then(res => {
    //     console.log(res);
    //     this.Meallists = res.result.data;
    //     this.totle3s = res.result.count;
    //   });
    // },
    // fenyeBtn2s(e) {
    //   this.page2s = e;
    //   this.getsetMeal(this.page2s, this.num2s);
    // },
    // fenyeBtn3s(e) {
    //   this.page3s = e;
    //   this.getsetMeals(this.page3s, this.num3s);
    // },
    //消费记录
    getconsume(page, num) {
      let parmes = {
        page: page || this.page4,
        limit: num || this.num4,
        user_id: this.getinfodata.id,
      };
      consume({
        request_data: Base64.encode(JSON.stringify(parmes)),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.consumptionrecordlist = res.result.data;
        this.totle4 = res.result.count;
      });
    },
    //邀请记录
    getinvitation(page, num) {
      let parmes = {
        page: page || this.page5,
        limit: num || this.num5,
        user_id: this.getinfodata.id,
      };
      invitation({
        request_data: Base64.encode(JSON.stringify(parmes)),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.recordtableData = res.result.data;
        this.totle5 = res.result.count;
      });
    },
    //会议室记录
    getmeeting(page, num) {
      let parmes = {
        page: page || this.page6,
        limit: num || this.num6,
        user_id: this.getinfodata.id,
      };
      meeting({
        request_data: Base64.encode(JSON.stringify(parmes)),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.roomtableData = res.result.data;
        this.totle6 = res.result.count;
      });
    },
    //使用套餐列表信息
    getusersetMeal(page, num) {
      let parmes = {
        page: page || this.page7,
        limit: num || this.num7,
        user_id: this.getinfodata.id,
      };
      usersetMeal({
        request_data: Base64.encode(JSON.stringify(parmes)),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.usermealData = res.result.user_set;
        this.totle7 = res.result.count;
      });
    },
    //用户门店储值卡列表
    getuserstored() {
      let parmes = {
        user_id: this.getinfodata.id,
      };
      stored({
        request_data: Base64.encode(JSON.stringify(parmes)),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.userstoreData = res.result;
        // this.totle8 = res.result.count
      });
    },
    //用户coupon列表
    getCouponList() {
      let parmes = {
        user_id: this.getinfodata.id,
        page:1,
        limit:40
      };
      couponList({
        request_data: Base64.encode(JSON.stringify(parmes)),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        res.result.data.forEach(item=>{
          item.start_time=this.getSimpleDate(item.start_time* 1000)
          item.end_time=this.getSimpleDate(item.end_time* 1000)
          item.status=item.status==1?'未使用':'已使用'
        });
         this.couponListData = res.result.data
        console.log('couponListData===',this.couponListData)
        // this.totle8 = res.result.count
      });
    },
     getSimpleDate(timestamp) {
   return new Date(timestamp)
    .toLocaleString('zh-CN', {
      year: 'numeric',
      month: '2-digit',
      day: '2-digit',
      hour: '2-digit',
      minute: '2-digit',
      second: '2-digit',
      hour12: false // 24小时制
    })
    .replace(/\//g, '-') // 替换斜杠为横杠
    .replace(/(\d{4}-\d{2}-\d{2})\s(\d{2}:\d{2}:\d{2})/, '$1 $2'); // 确保格式正确
 
},
    delCoupon(row){
      console.log('ropw=====',row) 

      this.$confirm(`是否删除${row.coupon_name}优惠券, 是否继续?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
           couponDel({
       request_data: Base64.encode(
          JSON.stringify({
            coupon_id:row.id,
            id:row.id,
           })
        ),
       }).then(res=>{
        this.$message({
            type: 'success',
            message: '删除成功'
          }); 
          this.getCouponList()
       })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });          
        });
     
    },
    cellStyle() {
      return "background:#f8f8f8;padding-left:12px;";
    },
    handleClosed() {
      this.$refs.recharge.resetFields();
    },
    handleClosed1() {
      this.isshop = false;
      this.currentindex = -1;
      this.genid = "";
      this.typeid = "";
      this.serialid = "";
      this.formappointment.selectpackage = "";
      this.$refs.formappointment.resetFields();
    },
    handleClosed2() {
      this.$refs.payform.resetFields();
      this.isdaynum = false;
    },
    handleClose(tag, index) {
      let parmes = {
        user_id: this.getinfodata.id,
        key: index,
      };
      labelDel({
        request_data: Base64.encode(JSON.stringify(parmes)),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        if (res.status == 1) {
          // let inputValue = this.inputValue;
          // if (inputValue) {
          //   this.dynamicTags.push(inputValue);
          // }
          this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
          this.$message({
            message: "删除成功",
            type: "success",
          });
        } else {
          this.$message({
            message: "删除失败",
            type: "error",
          });
        }
      });
    },

    showInput() {
      this.inputVisible = true;
      this.$nextTick(() => {
        this.$refs.saveTagInput.$refs.input.focus();
      });
    },

    handleInputConfirm() {
      let parmes = {
        user_id: this.getinfodata.id,
        label: this.inputValue,
      };
      if (this.inputValue == "" || this.inputValue === null) {
        this.inputVisible = false;
        return;
      }
      userLabel({
        request_data: Base64.encode(JSON.stringify(parmes)),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        if (res.status == 1) {
          if (this.dynamicTags === null) {
            this.dynamicTags = [];
          }
          let inputValue = this.inputValue;
          if (inputValue) {
            this.dynamicTags.push(inputValue);
          }
          this.inputVisible = false;
          this.inputValue = "";
          this.$message({
            message: "添加成功",
            type: "success",
          });
        } else {
          this.$message({
            message: "添加失败",
            type: "error",
          });
        }
      });
    },
    //选择预约店铺
    changestores(e) {
      console.log(this.formappointment.store_shop);
      console.log(this.formappointment.date1);
      console.log(this.tits);

      this.currentindex = -1;
      this.genid = "";
      this.typeid = "";
      this.serialid = "";
      this.formappointment.selectpackage = "";
      this.isdaynum = false;
      this.formappointment.store_shop = e;
      if (this.formappointment.store_shop != "") {
        // this.isshop = true;
        this.itemlist.length = 0;
        if (this.tits == "添加预约") {
          this.getappointReturn();
          this.getpackageReturn(e);
        } else if (this.tits == "固定座位") {
          if (
            this.formappointment.store_shop != "" &&
            this.formappointment.date1 != ""
          ) {
            this.getappointReturn1();
            this.getpackageReturn(e);
          }
        }
      }
    },
    //固定座位选择日期
    changestarttimes(e) {
      this.getappointReturn1();
      if (this.formappointment.store_shop != "") {
        this.getpackageReturn(this.formappointment.store_shop);
      }
      this.formappointment.date1 = e;
    },
    changeupstore(e) {
      this.storelist.map((v) => {
        if (v.id == e) {
          this.store_name1 = v.store_name;
          return;
        }
      });
    },
    getpackageReturn(e) {
      packageReturn({
        request_data: Base64.encode(
          JSON.stringify({
            store_id: e,
            user_id: this.getinfodata.id,
            type: this.tits == "添加预约" ? 1 : 2,
          })
        ),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.Meallist = res.result;
        if (res.status == 1) {
          this.isshop = true;
        }
      });
    },
    changestartdata(e) {
      this.formappointment.date = e;
      this.getappointReturn();
    },
    // changeenddata(e) {
    //   this.formappointment.enddate = e;
    //   this.getappointReturn();
    // },
    changestartappo(e) {
      this.formappointment.appointmentstart = e;
      this.getappointReturn();
    },
    changeendappo(e) {
      this.formappointment.appointmentend = e;
      this.getappointReturn();
    },
    //选择套餐
    mealchage(event) {
      let obj = {};
      //  this.radio2 = ""
      obj = this.Meallist.find((item) => {
        //model就是上面的数据源
        return item.id === event; //筛选出匹配数据
      });
      this.typeid = obj.type;
      this.formappointment.selectpackage = event;
      // this.formappointment.selectpackage = e;
    },
    changeFu() {
      this.$forceUpdate();
    },
    //购买选择套餐
    buymealchage(event) {
      let obj = {};
      this.radio1 = "";
      obj = this.Meallists.find((item) => {
        //model就是上面的数据源
        return item.id === event; //筛选出匹配数据
      });
      this.typeid = obj.type;
      if (obj.type == 1) {
        this.isdaynum = true;
        this.daynumlist = obj.set;
      } else {
        this.isdaynum = false;
      }
    },
    chaged(index, id) {
      console.log('index',index)
      console.log('id',id)

      this.currents = index;
      this.current = id;
      switch (index) {
        case 0:
          this.getuserSet();
          break;
        case 1:
          this.getuserChange();
          break;
        case 2:
          this.getuserAppointment();
          break;
        case 3:
          this.getconsume();
          break;
        case 4:
          this.getinvitation();
          break;
        case 5:
          this.getmeeting();
          break;
        case 6:
          this.getusersetMeal();
          break;
        case 7:
          this.getuserstored();
        case 8:
          this.getCouponList();
          // this.getsellLocker()
          break;
      }
    },
    // personlinstall() {
    //   this.dialogVisible = true;
    // },
    // 关闭操作
    // closeDialog() {
    //   this.dialogVisible = false;
    // },
    closeDialogs() {
      this.delpopup = false;
    },
    rechargecloseDialogs() {
      this.rechargepopup = false;
    },
    resetForm(formappointment) {
      this.$refs[formappointment].resetFields();
      this.appointmentend = "";
      this.selectpackage = "";
      this.formappointment.date = "";
      this.formappointment.enddate = "";
      this.formappointment.appointmentstart = "";
    },
    submiteditForm(formInfo) {
      this.$refs[formInfo].validate((valid) => {
        if (valid) {
          if (this.mealtype == 1) {
            var parmesd = {
              id: this.mealid,
              // sum: this.formeditInfo.alltimes,
              num: this.formeditInfo.surplus,
              // hour: this.formeditInfo.hour,
              end_time: this.formeditInfo.value1,
            };
          }
          if (this.mealtype == 2) {
            var parmesd = {
              id: this.mealid,
              // sum: this.formeditInfo.alltimes,
              // num: this.formeditInfo.surplus,
              // hour: this.formeditInfo.hour,
              end_time: this.formeditInfo.value2,
            };
          }
          if (this.mealtype == 3) {
            var parmesd = {
              id: this.mealid,
              // sum: this.formeditInfo.alltimes,
              // num: this.formeditInfo.surplus,
              hour: this.formeditInfo.hour,
              end_time: this.formeditInfo.value1,
            };
          }
          operation({
            request_data: Base64.encode(JSON.stringify(parmesd)),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.editdatepopup = false;
            this.$refs[formInfo].resetFields();
            this.getuserSet();
            this.getusersetMeal();
          });
        } else {
          return false;
        }
      });
    },
    submiteditvalueForm(formInfo) {
      this.$refs[formInfo].validate((valid) => {
        if (valid) {
          let parmes = {
            money: this.formvalueInfo.surplu,
            user_id: this.getinfodata.id,
            us_id: this.us_id,
          };
          storedSub({
            request_data: Base64.encode(JSON.stringify(parmes)),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.$message({
              message: res.message,
              type: "success",
            });
            this.editvaluepopup = false;
            this.$refs[formInfo].resetFields();
            this.getuserstored();
          });
        } else {
          return false;
        }
      });
    },
    // submitForm(formInfo) {
    //   this.$refs[formInfo].validate(valid => {
    //     if (valid) {
    //       let parmes = {
    //         id: this.getinfodata.id,
    //         role_id: this.formInfo.type
    //       };
    //       userPersonnel({
    //         request_data: Base64.encode(JSON.stringify(parmes))
    //       }).then(res => {
    //         console.log(res.result);
    //         localStorage.setItem("personneltype", this.formInfo.type);
    //         this.dialogVisible = false;
    //       });
    //     } else {
    //       return false;
    //     }
    //   });
    // },
    // submitForms(deduction) {
    //   this.$refs[deduction].validate(valid => {
    //     if (valid) {
    //       this.delpopup = false;
    //     } else {
    //       return false;
    //     }
    //   });
    // },
    // 充值操作
    rechargesubmitForms(recharge) {
      this.$refs[recharge].validate((valid) => {
        if (valid) {
          let parmes = {
            recharge: this.recharge.point,
            store_id: this.recharge.shop,
            desc: this.recharge.remarks,
            store_name: this.store_name1,
            // pay_money: this.recharge.price,
            // term: this.recharge.expirationtime
            //   ? this.recharge.expirationtime
            //   : 0,
            user_id: this.getinfodata.id,
          };
          userChangeOrder({
            request_data: Base64.encode(JSON.stringify(parmes)),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.$message({
              message: "充值成功",
              type: "success",
            });
            this.rechargepopup = false;
            this.getuserChange();
          });
        } else {
          return false;
        }
      });
    },
    appointmentsubmitForm(formappointment) {
      this.$refs[formappointment].validate((valid) => {
        if (valid) {
          if (this.typeid == 1) {
            var parmesdd = {
              user_id: this.getinfodata.id,
              store_id: this.formappointment.store_shop,
              seat_id: this.formappointment.selectpackage,
              sub_start: this.formappointment.date,
              start_sub: this.formappointment.appointmentstart,
              // sub_end: this.formappointment.enddate,
              end_sub: this.formappointment.appointmentend,
              serial: this.serialid,
              desc: this.formappointment.remarks,
              set_day_id: this.typeid,
              serial_id: this.itemlist.length != 0 ? this.itemlist[0] : "",
              gen_id: this.genid,
              type: 1,
            };
          }
          if (this.typeid != 1) {
            var parmesdd = {
              user_id: this.getinfodata.id,
              store_id: this.formappointment.store_shop,
              seat_id: this.formappointment.selectpackage,
              sub_start: this.formappointment.date,
              start_sub: this.formappointment.appointmentstart,
              // sub_end: this.formappointment.enddate,
              end_sub: this.formappointment.appointmentend,
              serial: this.serialid,
              desc: this.formappointment.remarks,
              serial_id: this.itemlist.length != 0 ? this.itemlist[0] : "",
              gen_id: this.genid,
              type: 1,
            };
          }
          appointmentAdd({
            request_data: Base64.encode(JSON.stringify(parmesdd)),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            if (res.status == 1) {
              this.$message({
                message: res.message,
                type: "success",
              });
              this.getuserAppointment();
              this.appointment = false;
            }
          });
        } else {
          return false;
        }
      });
    },
    appointmentsubmitForms(formappointment) {
      this.$refs[formappointment].validate((valid) => {
        if (valid) {
          if (this.typeid == 1) {
            var parmesdd = {
              user_id: this.getinfodata.id,
              store_id: this.formappointment.store_shop,
              seat_id: this.formappointment.selectpackage,
              // sub_start: this.formappointment.date,
              // start_sub: this.formappointment.appointmentstart,
              // sub_end: this.formappointment.enddate,
              // end_sub: this.formappointment.appointmentend,
              serial: this.serialid,
              start_time: this.formappointment.date1[0],
              end_time: this.formappointment.date1[1],
              desc: this.formappointment.remarks,
              set_day_id: this.typeid,
              serial_id: this.itemlist.length != 0 ? this.itemlist[0] : "",
              gen_id: this.genid,
              type: 2,
            };
          }
          if (this.typeid != 1) {
            var parmesdd = {
              user_id: this.getinfodata.id,
              store_id: this.formappointment.store_shop,
              seat_id: this.formappointment.selectpackage,
              // sub_start: this.formappointment.date,
              // start_sub: this.formappointment.appointmentstart,
              // sub_end: this.formappointment.enddate,
              // end_sub: this.formappointment.appointmentend,
              serial: this.serialid,
              start_time: this.formappointment.date1[0],
              end_time: this.formappointment.date1[1],
              desc: this.formappointment.remarks,
              serial_id: this.itemlist.length != 0 ? this.itemlist[0] : "",
              gen_id: this.genid,
              type: 2,
            };
          }
          userSeat({
            request_data: Base64.encode(JSON.stringify(parmesdd)),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            if (res.status == 1) {
              this.$message({
                message: res.message,
                type: "success",
              });
              this.getuserAppointment();
              this.appointment = false;
            }
          });
        } else {
          return false;
        }
      });
    },
    // deleteRow() {
    //   this.delpopup = true;
    // },
    rechargepop() {
      this.rechargepopup = true;
    },
    addappointment() {
      this.appointment = true;
      this.tits = "添加预约";
      // setMeal;
    },
    fixedseat() {
      this.appointment = true;
      this.tits = "固定座位";
    },
    getappointReturn1() {
      if (this.formappointment.store_shop == "") {
        return;
      }
      let parmesd = {
        user_id: this.getinfodata.id,
        store_id: this.formappointment.store_shop,
        start_time: this.formappointment.date1[0],
        end_time: this.formappointment.date1[1],
        // start_sub: this.formappointment.appointmentstart,
        // end_sub: this.formappointment.appointmentend
      };
      appointmentReturn({
        request_data: Base64.encode(JSON.stringify(parmesd)),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.seatlist = res.result;
        // return res.data;
      });
    },
    getappointReturn() {
      // console.log(this.formappointment)
      // return
      let parmes = {
        user_id: this.getinfodata.id,
        store_id: this.formappointment.store_shop,
        start_time: this.formappointment.date,
        // end_time: this.formappointment.enddate,
        start_sub: this.formappointment.appointmentstart,
        end_sub: this.formappointment.appointmentend,
      };
      appointReturn({
        request_data: Base64.encode(JSON.stringify(parmes)),
      }).then((res) => {
        if (res.status == 2) {
          this.$message({
            message: res.message,
            type: "warning",
          });
          return;
        }
        this.seatlist = res.result;
        // return res.data;
      });
    },
    paypackage() {
      this.paypopup = true;
      this.Meallists = "";
    },
    paycancel() {
      this.paypopup = false;
    },
    payconfig(payform) {
      this.$refs[payform].validate((valid) => {
        if (valid) {
          if (this.typeid == 1) {
            if (this.radio1 == "") {
              this.$message({
                message: "请选择套餐",
                type: "warning",
              });
              return;
            }
            var parmesed = {
              user_id: this.getinfodata.id,
              seat_id: this.payform.mealchoose,
              store_id: this.storeid,
              num: this.buynum,
              money: this.payform.price,
              desc: this.payform.remarks,
              set_day_id: this.radio1,
              day: this.cardday,
              price: this.cardprice,
            };
          }
          if (this.typeid != 1) {
            var parmesed = {
              user_id: this.getinfodata.id,
              seat_id: this.payform.mealchoose,
              store_id: this.storeid,
              num: this.buynum,
              money: this.payform.price,
              desc: this.payform.remarks,
            };
          }
          buymeal({
            request_data: Base64.encode(JSON.stringify(parmesed)),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.$message({
              message: res.message,
              type: "success",
            });
            this.paypopup = false;
            this.getconsume();
          });
        } else {
          return false;
        }
      });
    },
    ckeckdatas(item, paritem) {
      this.genid = paritem.id;
      if (item.check == true) {
        return false;
      }
      this.currentindex = item.id;
      this.serialid = item.seat_name;
      // let index = this.itemlist.findIndex(ele => {
      //   return ele === item;
      // });
      this.itemlist[0] = item.id;
      // if (index != -1) {
      //   this.itemlist.splice(index, 1); //取消选中
      // } else {
      //   this.itemlist.push(item); //选中
      // }
    },
    radiochang(e) {
      this.radio1 = e;
      this.daynumlist.map((item) => {
        //model就是上面的数据源
        if (item.id == e) {
          this.cardday = item.day;
          this.cardprice = item.price;
        }
        // return item.id === event; //筛选出匹配数据
      });
    },
    isActiveFn(item) {
      //判断元素是否选中
      //index如果不是-1，那就说明是被选中的
      // let index = this.itemlist.findIndex(ele => {
      //   console.log(ele.id)
      //   return ele.id === item.id;
      // });
      if (item.id == this.itemlist[0]) {
        return true;
      } else {
        return false;
      }
    },
    refund(data) {
      this.$confirm("确定退款吗?此订单将取消并全额退还。", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          let parmes = {
            order_id: data.id,
          };
          reimburse({
            request_data: Base64.encode(JSON.stringify(parmes)),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.getuserAppointment();
          });
        })
        .catch(() => {
          // this.$message({
          //   type: 'info',
          //   message: '已取消'
          // });
        });
    },
    //取消订单
    concelorder(data) {
      this.$confirm("该取消订单无退款，是否确认取消订单！", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          let parmes = {
            type: "1",
            order_id: data.id,
          };
          userOrderCancel({
            request_data: Base64.encode(JSON.stringify(parmes)),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.getuserAppointment();
          });
        })
        .catch(() => {
          // this.$message({
          //   type: 'info',
          //   message: '已取消'
          // });
        });
    },
    refund5(data) {
      this.$confirm("确定退款吗?此订单将取消并全额退还。", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          let parmes = {
            order_id: data.id,
          };
          drawback({
            request_data: Base64.encode(JSON.stringify(parmes)),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.getmeeting();
          });
          // this.$message({
          //   type: 'success',
          //   message: '删除成功!'
          // });
        })
        .catch(() => {
          // this.$message({
          //   type: 'info',
          //   message: '已取消'
          // });
        });
    },
    //取消订单
    concelorder5(data) {
      this.$confirm("该取消订单无退款，是否确认取消订单！", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          let parmes = {
            type: "2",
            order_id: data.id,
          };
          userOrderCancel({
            request_data: Base64.encode(JSON.stringify(parmes)),
          }).then((res) => {
            if (res.status == 2) {
              this.$message({
                message: res.message,
                type: "warning",
              });
              return;
            }
            this.getmeeting();
          });
        })
        .catch(() => {
          // this.$message({
          //   type: 'info',
          //   message: '已取消'
          // });
        });
    },
    // viewdetails(data) {
    //   this.appointmentdetails = true;
    //   this.appoopopupdata = data;
    // },
    // viewdetails5(data) {
    //   this.roomdetails = true;
    //   this.roomdata = data;
    // },
    handleChange(value) {
      this.buynum = value;
    },
  },
};
</script>
<style scoped>
.el-table .cell {
  display: flex !important;
  align-items: center !important;
}
</style>
<style lang="scss" scoped>
.block6 {
  background-color: rgba(255, 254, 250, 1);
  height: auto;
  border: 1px solid rgba(240, 242, 245, 1);
  width: 98%;
  margin: 26px 0 15px 12px;
}

.outer2 {
  width: 100%;
  height: auto;
}

.section5 {
  background-color: rgba(249, 249, 249, 1);
  height: 49px;
  border-right: 1px solid rgba(240, 242, 245, 1);
  border-bottom: 1px solid rgba(240, 242, 245, 1);
  width: 100%;
  padding: 10px 0 0 10px;
  box-sizing: border-box;
}

.section6 {
  width: 100%;
  height: 28px;
  display: flex;
  justify-content: space-between;
}

.word9 {
  width: 63px;
  height: 15px;
  overflow-wrap: break-word;
  color: rgba(51, 51, 51, 1);
  font-size: 16px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 16px;
  margin-top: 6px;
  display: block;
}

.bd7 {
  background-color: rgba(64, 158, 255, 1);
  border-radius: 4px;
  height: 28px;
  width: 80px;
  padding: 7px 0 0 13px;
}

.word10 {
  width: 55px;
  height: 13px;
  overflow-wrap: break-word;
  color: rgba(255, 255, 255, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  display: block;
}

.section7 {
  width: 100%;
  height: auto;
  margin: 20px 0 0 26px;
  display: flex;
}

.SingleAvatar24 {
  // background-color: rgba(192, 196, 204, 1);
  border-radius: 50%;
  height: 60px;
  margin-top: 5px;
  width: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.label2 {
  width: 1005;
  height: 100%;
  border-radius: 50%;
}

// .group1 {
//   width: 27px;
//   height: 46px;
//   margin-left: 29px;
// }

.word11 {
  overflow-wrap: break-word;
  color: rgba(145, 145, 145, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  display: block;
}
.word12 {
  overflow-wrap: break-word;
  color: rgba(145, 145, 145, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  margin-top: 18px;
  display: block;
}

// .group2 {
//   width: 54px;
//   height: 46px;
//   margin-left: 12px;
// }

// .word13 {
//   width: 54px;
//   height: 14px;
//   overflow-wrap: break-word;
//   color: rgba(51, 51, 51, 1);
//   font-size: 14px;
//   font-family: SourceHanSansSC-Normal;
//   text-align: left;
//   white-space: nowrap;
//   line-height: 14px;
//   display: block;
// }

// .txt3 {
//   width: 54px;
//   height: 14px;
//   overflow-wrap: break-word;
//   color: rgba(51, 51, 51, 1);
//   font-size: 14px;
//   font-family: SourceHanSansSC-Normal;
//   text-align: left;
//   white-space: nowrap;
//   line-height: 14px;
//   margin-top: 18px;
//   display: block;
// }

// .group3 {
//   width: 28px;
//   height: 45px;
//   margin-left: 294px;
// }

.word14 {
  overflow-wrap: break-word;
  color: rgba(145, 145, 145, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  margin-left: 1px;
  display: block;
}
.flexwap {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}
.txt4 {
  overflow-wrap: break-word;
  color: rgba(145, 145, 145, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  margin-top: 18px;
  display: block;
}
.txt4s {
  overflow-wrap: break-word;
  color: #fff;
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  margin-top: 18px;
  display: block;
}
// .txt5 {
//   width: 83px;
//   height: 12px;
//   overflow-wrap: break-word;
//   color: rgba(51, 51, 51, 1);
//   font-size: 14px;
//   font-family: SourceHanSansSC-Normal;
//   text-align: left;
//   white-space: nowrap;
//   line-height: 14px;
//   display: block;
//   margin: 1px 0 0 13px;
// }

// .txt6 {
//   width: 27px;
//   height: 14px;
//   overflow-wrap: break-word;
//   color: rgba(145, 145, 145, 1);
//   font-size: 14px;
//   font-family: SourceHanSansSC-Normal;
//   text-align: left;
//   white-space: nowrap;
//   line-height: 14px;
//   margin-left: 262px;
//   display: block;
// }

.info3 {
  overflow-wrap: break-word;
  color: rgba(145, 145, 145, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  display: block;
}

// .group4 {
//   width: 56px;
//   height: 46px;
//   margin-left: 337px;
// }

.word15 {
  overflow-wrap: break-word;
  color: rgba(145, 145, 145, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  margin-left: 1px;
  display: block;
}

.word16 {
  overflow-wrap: break-word;
  color: rgba(145, 145, 145, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  margin-top: 18px;
  display: block;
}

// .group5 {
//   width: 20px;
//   height: 46px;
//   margin-left: 7px;
// }

.info4 {
  overflow-wrap: break-word;
  color: rgba(51, 51, 51, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  display: block;
}

// .txt7 {
//   width: 20px;
//   height: 14px;
//   overflow-wrap: break-word;
//   color: rgba(51, 51, 51, 1);
//   font-size: 14px;
//   font-family: SourceHanSansSC-Normal;
//   text-align: left;
//   white-space: nowrap;
//   line-height: 14px;
//   margin-top: 18px;
//   display: block;
// }

.section8 {
  // width: 94%;
  height: 1px;
  background: rgba(240, 242, 245, 1);
  margin: 11px 0 0 101px;
}
.info5 {
  height: 14px;
  overflow-wrap: break-word;
  color: rgba(145, 145, 145, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  display: block;
  margin: 16px 0 0 114px;
}
.boxtips {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-left: 120px;
  margin-top: 10px;
  margin-bottom: 20px;
}
.section9 {
  background-color: rgba(255, 255, 255, 1);
  border-radius: 2px;
  height: 32px;
  border: 1px solid rgba(240, 242, 245, 1);
  width: 80px;
  margin: 3px 0 20px 126px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.word17 {
  width: 54px;
  height: 14px;
  overflow-wrap: break-word;
  color: rgba(51, 51, 51, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  display: block;
}
.section10 {
  background-color: rgba(249, 249, 249, 1);
  z-index: 103;
  height: 40px;
  border-top: 1px solid rgba(240, 242, 245, 1);
  border-left: 1px solid rgba(240, 242, 245, 1);
  border-right: 1px solid rgba(240, 242, 245, 1);
  width: 98%;
  margin-left: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* position: absolute;
  left: 12px;
  top: 344px; */
}

.mod2 {
  width: auto;
  height: 40px;
  display: flex;
  cursor: pointer;
}

.section11 {
  background-color: rgba(255, 255, 255, 1);
  height: 40px;
  border: 1px solid rgba(240, 242, 245, 1);
  width: 98px;
  padding: 12px 0 0 20px;
}

.word24 {
  width: 56px;
  height: 13px;
  overflow-wrap: break-word;
  color: rgba(64, 158, 255, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  display: block;
}

.info10 {
  width: 56px;
  height: 13px;
  overflow-wrap: break-word;
  color: rgba(51, 51, 51, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  display: block;
  margin: 13px 0 0 21px;
}

.info11 {
  width: 56px;
  height: 13px;
  overflow-wrap: break-word;
  color: rgba(51, 51, 51, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  display: block;
  margin: 13px 0 0 41px;
}

.block7 {
  background-color: rgba(255, 255, 255, 1);
  height: auto;
  border: 1px solid rgba(240, 242, 245, 1);
  width: 98%;
  margin: 0 0 50px 12px;
  padding: 15px 0 0 15px;
}

.block8 {
  height: auto;
  margin-bottom: 26px;
}

.layer3 {
  width: auto;
  height: 27px;
  margin: 20px 0 10px 10px;
  display: flex;
}

.block10 {
  background-color: rgba(186, 186, 186, 1);
  width: 10px;
  height: 16px;
  margin-top: 11px;
}

.info6 {
  // width: auto;
  // height: 14px;
  overflow-wrap: break-word;
  color: rgba(51, 51, 51, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  display: block;
  margin: 12px 0 0 13px;
}

.info7 {
  width: 55px;
  height: 14px;
  overflow-wrap: break-word;
  color: rgba(145, 145, 145, 1);
  font-size: 14px;
  font-family: SourceHanSansSC-Normal;
  text-align: left;
  white-space: nowrap;
  line-height: 14px;
  margin-left: 705px;
  display: block;
}
.optionitems {
  width: 98px;
  height: 40px;
  background: #ffffff;
  // border-left: 1px solid #f0f2f5;
  // border-right: 1px solid #f0f2f5;
  // border-bottom: 1px solid #f0f2f5;
  border: 1px solid #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #409eff;
  font-size: 14px;
}
.optionitems:nth-child(1) {
  border-left: none;
}
.cell {
  display: flex;
  align-items: center;
}
.optionitem {
  background-color: rgba(249, 249, 249, 1);
  color: rgba(51, 51, 51, 1);
  width: 98px;
  height: 40px;
  display: flex;
  border-bottom: 1px solid #f0f2f5;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.active {
  position: relative;
  width: 52px;
  height: 52px;
  background: #512cff;
  border-radius: 6px;
  color: #512cff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  margin-bottom: 8px;
}
.itemcont {
  width: 52px;
  height: 52px;
  background: #ffffff;
  border: 1px solid #512cff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  margin-bottom: 8px;
  color: #101010;
  font-size: 20px;
  cursor: pointer;
}
.itemconts {
  cursor: not-allowed;
  width: 52px;
  height: 52px;
  background: #ffffff;
  border: 1px solid #bbbbbb;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  margin-bottom: 8px;
  color: #b9b9b9;
  font-size: 20px;
}
.tips1 {
  width: 90%;
  height: auto;
  background: #ffffff;
  box-shadow: 0px 0px 10px 0px rgba(55, 55, 55, 0.2);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 45px auto 20px;
}
.tips2 {
  width: 90%;
  height: auto;
  background: #ffffff;
  box-shadow: 0px 0px 10px 0px rgba(55, 55, 55, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 45px auto 100px;
}
.centtip {
  margin: 45px auto;
  width: 90%;
}
.el-tag + .el-tag {
  margin-left: 10px;
}
.button-new-tag {
  margin-left: 10px;
  height: 32px;
  line-height: 30px;
  padding-top: 0;
  padding-bottom: 0;
}
.input-new-tag {
  width: 90px;
  margin-left: 10px;
  vertical-align: bottom;
}
</style>
